close websocket immediately if graphic is removed