detect_finish