fixed issue that let the tests fail in headless mode