Fix getEntityManager