fix an update method and added its test case