Go to author's website (here) and get last version (just checked and it's v1.1) as doesn't seem to have that missing "state(body)" variable and thus might fix the issue you are having.
Once the game is over, the king and the pawn go back in the same box.