added try/catch to open