a better filename check