State machine timing fix