added headless support