added connectDB function