Improving error logic
Preventing node websocket from crashing for dev.