Pass local variable to closure