diff --git a/cpu/kernelcreation.py b/cpu/kernelcreation.py
index af2ddae9c3a1029491f1026ff9281bf09ed0f6fc..0c96c1f4557f16235a785ceec71f464f0833d4ca 100644
--- a/cpu/kernelcreation.py
+++ b/cpu/kernelcreation.py
@@ -37,7 +37,7 @@ def createKernel(listOfEquations, functionName="kernel", typeForSymbol='double',
         if isinstance(term, Field.Access) or isinstance(term, TypedSymbol):
             return term
         elif isinstance(term, sp.Symbol):
-            if isinstance(typeForSymbol, str):
+            if not hasattr(typeForSymbol, '__getitem__'):
                 return TypedSymbol(term.name, createType(typeForSymbol))
             else:
                 return TypedSymbol(term.name, typeForSymbol[term.name])