bug fix to URL handling