diff --git a/integration_tests/CMakeLists.txt b/integration_tests/CMakeLists.txt
index 2c360fd51d..d320517100 100644
--- a/integration_tests/CMakeLists.txt
+++ b/integration_tests/CMakeLists.txt
@@ -606,6 +606,7 @@ RUN(NAME test_import_04      LABELS cpython llvm llvm_jit c)
 RUN(NAME test_import_05      LABELS cpython llvm llvm_jit c wasm wasm_x86 wasm_x64)
 RUN(NAME test_import_06      LABELS cpython llvm llvm_jit)
 RUN(NAME test_import_07      LABELS cpython llvm llvm_jit c)
+RUN(NAME test_import_08      LABELS cpython llvm)
 RUN(NAME test_math           LABELS cpython llvm llvm_jit NOFAST)
 RUN(NAME test_membership_01  LABELS cpython llvm)
 RUN(NAME test_numpy_01       LABELS cpython llvm llvm_jit c)
diff --git a/integration_tests/test_import_08.py b/integration_tests/test_import_08.py
new file mode 100644
index 0000000000..80b1bffa0f
--- /dev/null
+++ b/integration_tests/test_import_08.py
@@ -0,0 +1,3 @@
+import string
+
+import test_import_08_module
diff --git a/integration_tests/test_import_08_module.py b/integration_tests/test_import_08_module.py
new file mode 100644
index 0000000000..f92430e846
--- /dev/null
+++ b/integration_tests/test_import_08_module.py
@@ -0,0 +1,6 @@
+from lpython import i32
+
+a: i32 = 10
+b: i32 = a + 10
+
+print("Inside import")
diff --git a/src/lpython/semantics/python_ast_to_asr.cpp b/src/lpython/semantics/python_ast_to_asr.cpp
index fac917eaf4..a44694d95d 100644
--- a/src/lpython/semantics/python_ast_to_asr.cpp
+++ b/src/lpython/semantics/python_ast_to_asr.cpp
@@ -4910,6 +4910,16 @@ class SymbolTableVisitor : public CommonVisitor<SymbolTableVisitor> {
                 throw SemanticError("The module '" + mod_sym + "' cannot be loaded",
                         x.base.base.loc);
             }
+            if( mod_sym == "__init__" ) {
+                for( auto item: ASRUtils::symbol_symtab(t)->get_scope() ) {
+                    if( ASR::is_a<ASR::ExternalSymbol_t>(*item.second) ) {
+                        current_module_dependencies.push_back(al,
+                            ASR::down_cast<ASR::ExternalSymbol_t>(item.second)->m_module_name);
+                    }
+                }
+            } else {
+                current_module_dependencies.push_back(al, s2c(al, mod_sym));
+            }
         }
     }
 
@@ -5114,6 +5124,7 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
             tmp = nullptr;
             tmp_vec.clear();
             visit_stmt(*x.m_body[i]);
+            
             for (auto t: global_init) {
                 if (t) {
                     items.push_back(al, t);