change to entitymanager