fix database connection.