fix update routine