edit function on recieving