bug fix on lost connection