fix window.socket error