use the controller method instead of directly getting the entity manager