prevent KeyError when task done