fixed unreturned connection: closing the entity manager to return the db connection to the pool