improved update method