changes of main to include the entity manager