data-sort: now index_fd can be negative