fix for recursive sorting categories