fixed bug where incorrect variable name was referenced