Added closures on event handlers