Throw undefined_variable in for loops