fixed issue with multiple event listeners being created