made the update method working