Use upgrade needed event if available, and cleaned old listeners to avoid double callbacks.