added fix for slow query issue in collection delete API