Uncaught exception: Call to a member function setLayout() on null