update variable bug