fix 'dict_items' object has no attribute 'sort'