remove wrapper of checking connection in retry function