Call to a member function isInTransaction() on null