try and catch the connection