diff --git a/kadmos/vistoms/vistoms.py b/kadmos/vistoms/vistoms.py
index e4e5ab44c044dc2e200a899ccdf08f8c90445891..501974dd5c1945f146886bfd902cb54de2e4cbb9 100644
--- a/kadmos/vistoms/vistoms.py
+++ b/kadmos/vistoms/vistoms.py
@@ -124,11 +124,11 @@ def kadmosUploadFile():
 
                 # Use function order for VISTOMS if it is available in the graph information
                 function_order = None
-                if graph.graph_has_nested_attributes('problem_formulation', 'function_order'):
+                if graph.graph_has_nested_attributes('problem_formulation', 'function_order') and mpg==None:
                     function_order = graph.graph['problem_formulation']['function_order']
 
                 # Add the graph with the updated function order to VISTOMS
-                newVistomsData = graph.vistoms_add_json(graph_id=newGraphID, mpg=mpg, function_order=function_order)
+                newVistomsData = graph.vistoms_add_json(graph_id=newGraphID, function_order=function_order, mpg=mpg)
 
                 return newVistomsData
 
@@ -378,7 +378,7 @@ def kadmosFindTempGraphs():
 
                     # Use function order for VISTOMS if it is available in the graph information
                     function_order = None
-                    if graph.graph_has_nested_attributes('problem_formulation', 'function_order'):
+                    if graph.graph_has_nested_attributes('problem_formulation', 'function_order') and mpg == None:
                         function_order = graph.graph['problem_formulation']['function_order']
 
                     graph.save(os.path.join(UPLOAD_FOLDER, graphFileName), file_type="kdms",