moved update in write