task: adding error handling for websocket being created too early, see issue #4