fix event listeners overwriting each other