small update on update function