fix repeat to create database connection

`ping()` return type is error.