Fix a small typo in update() function