use entityManager in index controller