Resetting the event listeners array so that events get added properly.