Fixed syntax error in update function