Fix unexpected behaviour at the event of sweepingDone.