Checking for illegal characters in out file name