fixed the error in reading the input filename