update length when no port is provided