Change try/except to checking conn status