fix logic for source searches