Remove leaves function added