Fixed bug where extra event listeners being made