Added the delete flag, and kept the track for the deleted records;