Improve check for fileName