making update atomic