fix to use alternative entity manager