when I change the flag `optimize` to **false** then the result from `generateMenu` become flat without any children.