implementation of update