Database connection improved