Fixed state machine error