fixes #238 and bad bug in canopy creation