folding maze: bug fix

bug fix