added list of undefined variable to exception that is raised in this case (fixed variable name matching)