Mark this block of code. It looks that it will destroy the state machine.