bug fix on update method