various changes to run headless