Potential fix on matchEnded event called twice bug