fixed bug in normalizeSorting