fixed closure on event handlers