fixed isleaf