fix database max connection issue