Added error catching for connections made via mech