fix a bug in remapping data