moved menu tree to preprocess function