set state by url and url by state when no url