fix stdev bug