fix update code