update the entity