Fix event listener being added twice