ks_ip is none so line 426 doesn't get unbound variable