Ok - sorry, yes - connection.transaction can go away if the check takes a while and the connection hangs up whilst  the check is still running.   However, we don't need the else() block here.