Added headless mode