adding edit function