Fix create a url after restoring previous query