fixed 'Call to a member function getFormType() on a non-object'