Added bad character checking in file name