added port and used dict for url formatting