Fixed out-of-scope variable name in closure