-Fixed Bug in state machine that would have skipped last state