removed modification of file when exception is thrown