fixed setPort if no port or scheme is detected