Making sure entity manager is available