diff --git a/question/engine/upgrade/behaviourconverters.php b/question/engine/upgrade/behaviourconverters.php
index 5807c02..8ca9bfb 100644
--- a/question/engine/upgrade/behaviourconverters.php
+++ b/question/engine/upgrade/behaviourconverters.php
@@ -195,7 +195,28 @@ abstract class question_behaviour_attempt_updater {
                 $this->logger->log_assumption("Ignoring second start state with blank answer in attempt at question {$state->question}");
                 return;
             } else {
-                throw new coding_exception("Two inconsistent open states for question session {$this->qsession->id}.");
+                // if $state has the same seq_number, timestamp but larger ID than the first state,
+                // make $state the first state
+                if ($state->seq_number == $this->qstates[0]->seq_number &&
+                    $state->timestamp  == $this->qstates[0]->timestamp &&
+                    $state->id > $this->qstates[0]->id) {
+
+                    // find the index of $state
+                    $state_ind = -1;
+                    for ($i = 0; $i < count($this->qstates); $i++) {
+                        if ($this->qstates[$i]->id == $state->id) {
+                            $state_ind = $i;
+                            break;
+                        }
+                    }
+
+                    // swap the two states
+                    $this->qstates[$state_ind] = $this->qstates[0];
+                    $this->qstates[0] = $state;
+                }
+                else {
+                    throw new coding_exception("Two inconsistent open states for question session {$this->qsession->id}.");
+                }
             }
         }
         $step->state = 'todo';
