fixed issue with multiple event listeners