fix: the entity manager is closed issue.