added an error check when the user did not provide a file name