fix db connection check