keyword `this` inside closures referring to wrong object