fixing issue with average

fixing a mistyped variable name, so the average file is now generated