minor bug fix on updating the current value