preserve ptr in data field during sorting