Error: Call to a member function getType() on null: Page not found