set 'this' to a variable before entering the closure function