fix entity manager call