Check specifically for pending and waiting tasks.
Only remove existing uuids if they are found.
Log a little more here.