dict fix in sorting