Error: Call to a member function getActive() on null: