Fix move to previous state bug