fix ensemble mean calculation