fix database connection