Fixed where invalid variable name was being referenced