added a procedure to the sortBy method to renumber the id of each row according to the array order after uasort()