fix bug with searching when first criteria is empty and second is filled