added an exception for when a file is not regular or a directory, called FileException()