fix a bug in dedup phase