fix bugs, and add websocket keep alive.