limit the number of event listeners