moved the update method