Turn callbackCalled and finishCalled into numbers that you increment in the event listener, then check here if they equal 1.

Your current approach is not wrong but it won't catch callbacks or events getting invoked/emitted twice.