Use a flag to pass the windows states around