custom events trigger only after all the steps before them have been completed
as long as the state is before the custom event it should trigger fine
to enforce it you could pass the states value into the custom event… although this shouldn’t be necessary
there may also be something else clearing the state/changing it