update variable to correct scope