fix bug in dedup script