update edit function