Improved way to detect a transition completion