adding replaceState method