edited generate_error_data