add stash in update function