fixed filtering and selecting in batches