fix url value logic and only save same url once to localStorage