Fix the bug in makeCanopy