make update function