Added Try Catch blocks, fixed another file permission issue