make sure file in main is a valid filename