eventHandler take loops in parameters for them to access to window