reversing isleaf flag