fix missing variable: total_data