fixed bug in multiple input file handling