Quick fix to URL resolving code