fix bugs in input file