ave method had a bug