repair bug by preferring setIntermediate to nextTick when both are available