Fixed bug of incorrect variable.