add FileException class and some minor improvments