add option to write search results to a file