Updated update function

Added some debugging and wondered why the previous changes didn't get
synched.