Modify save function to delete the record first before deleting.