execute onbeforechange handler in a same tick so it happens before the step is really shown