fix cross domain bug when disconnect