fix error that was trying to set a variable that did not exist yet