clean up the client-side interaction when client is run in headless mode