fixed condition bug in build_module