fix db disconnect