adding option for port and fixing url host is null bug