fix broken update code