changed update code