added the edit function