Made entity manager optional