added port support to fix_url method