fix EntityManager use