checked if the collection exist for recovering deleted records
--deleted is tested for new design
re-designed code layout, clearer than before