handle websocket client errors to prevent crash

Hi this is what i do to prevent the server crash mentioned in issue #100