take care about WebSocket state before start listening