add try catch to connection attempts