fix task finish time detection