Error thrown

Call to a member function removeChild() on null