Improved waitForLight but still buggy