check connection status & reconnect