Added more locking for webview/websocket