fixed save and cancel functions, also did delete function