diff --git a/linux-ramdump-parser-v2/parsers/memstat.py b/linux-ramdump-parser-v2/parsers/memstat.py
index 02c0b1049048fcd1be87cd14302303c75682ab0b..5963289429f428b8bb60f4eb1e9b0bd66da4fa86 100644
--- a/linux-ramdump-parser-v2/parsers/memstat.py
+++ b/linux-ramdump-parser-v2/parsers/memstat.py
@@ -222,7 +222,11 @@ class MemStats(RamParser):
         # vmalloc area
         self.calculate_vmalloc()
 
-        accounted_mem = total_free + total_slab + ion_mem + kgsl_memory + \
+        if type(ion_mem) is str:
+            accounted_mem = total_free + total_slab + kgsl_memory + \
+                            self.vmalloc_size + other_mem
+        else:
+            accounted_mem = total_free + total_slab + ion_mem + kgsl_memory + \
                         self.vmalloc_size + other_mem
 
         unaccounted_mem = total_mem - accounted_mem