Added search scope and corrected search algorithm to clean up whitelist