fix duplicates by using replaceState.