update code by xhr 2