fixed the remap bug