fix bug. assign avg at generate_output
v0.2.4