moved enclosing check into Connection