fix lost connection bug