checking for a nil connection