Added duration for switch state change