clean up websocket writer and controller