close websocket before unload
fix typo again