creating the edit function