Incorrect variable name being referenced