fix a problem in generating the search urls (last &amp; stripping)