Add switching of headless or non-headless modes