Fix update method of entity class