sometimes the delay added by a WakingUp event is not equals to the transition duration. fixed the code to adhere to this reality