Fixed the update method