Change persist function to return the entity persisted