add debugging for categories in wrong order