added web socket error handling