created dbConnect function