process before sorting