Database connection fix