ddl: make sure items are sorted correctly