corrected update function