changes location.search.replace to match for better matching