Recover target id when detecting.