changed update operation logic