delete trashed: fix mem leak; implement batch processing