One of my students used the following code for the maze, and it ended up not succeeding. However, the avatar does navigate to the end, runs into the wall, and then fails. Is it because of the second "move forward"?

<xml><block type="maze_moveForward" id="6" x="70" y="70"><next><block type="maze_forever" id="7"><statement name="DO"><block type="maze_moveForward" id="8"><next><block type="maze_if" id="9"><field name="DIR">isPathRight</field><statement name="DO"><block type="maze_turn" id="10"><field name="DIR">turnRight</field></block></statement><next><block type="maze_if" id="11"><field name="DIR">isPathLeft</field><statement name="DO"><block type="maze_turn" id="12"><field name="DIR">turnLeft</field></block></statement><next><block type="maze_moveForward" id="13"><next><block type="maze_if" id="14"><field name="DIR">isPathRight</field><statement name="DO"><block type="maze_turn" id="15"><field name="DIR">turnRight</field></block></statement></block></next></block></next></block></next></block></next></block></statement></block></next></block></xml>