added headless flag