check for data field before sorting