Changed on to addEventListener to see if I can trigger the end event