fix bugs in include logic