Solved bug at stats.mean_var