Fix call of entity manager