fixed bug to make websocket state go from opening to open