migrating existing data to new format/deleting record and flash error message