add na.rm to mean() calculation