change invalid variable to correct variable