better file handling if there's no input directory