fix menu generation depth accuracy. #251