Fixes scope error in list comprehension