Call to a member function createView() on null