Debugging connection error + attempt to make connections more robust