ScanFile and retrieve results and write to file but input list not working