fixed use of incorrect variable