detect and resolve race condition where finished task is scheduled.