implement include in terms of detect
(cherry picked from commit 1b1943b0caa7b54d0f6bb1dbba65c7b5439784c9)