fix :after events on state transitions