make getCategory work for generic leaves