Fixed input file bug when passing in a directory vs a file

Fixed bug when passing in a directory instead of a normal text file