check for null connection