When used jquery func $.unique the categories were also sorted and this caused that data index was mapped to wrong category