deletion by query, removed unused code