websocket crash fixes
additional connection check
Merge pull request #491 from nikhan/439_fix

439 fix (crashes)