setVar method was not really working in headless way, so this was fixed.