diff --git a/runtime-management/runtime-management-impl/src/main/resources/eval.py b/runtime-management/runtime-management-impl/src/main/resources/eval.py
index <HASH>..<HASH> 100644
--- a/runtime-management/runtime-management-impl/src/main/resources/eval.py
+++ b/runtime-management/runtime-management-impl/src/main/resources/eval.py
@@ -155,10 +155,13 @@ class PythonAgentExecutor(object):
                                 'returnType': return_type}
             finally:
                 self.__enable_standard_io(old_io)
+
+            final_result = json.dumps(final_result)
+
         except Exception as e:
             final_result = {'exception': str(e)}
 
-        print(json.dumps(final_result))
+        print(final_result)
 
 
 class AccessAwareDict(dict):
catch any exception which might occur when converting result to json