diff --git a/nbdiff/commands.py b/nbdiff/commands.py
index <HASH>..<HASH> 100644
--- a/nbdiff/commands.py
+++ b/nbdiff/commands.py
@@ -9,7 +9,7 @@ from .notebook_parser import NotebookParser
 import json
 import sys
 from .notebook_diff import notebook_diff
-
+import IPython.nbformat.current as nbformat
 
 def diff():
     parser = argparse.ArgumentParser()
@@ -111,10 +111,12 @@ def merge():
         app.pre_merged_notebook = pre_merged_notebook
 
         def save_notebook(notebook_result):
-            import json
-            parsed = json.loads(notebook_result)
+            #import json
+            #parsed = json.loads(notebook_result)
+            parsed = nbformat.reads(notebook_result, 'json') 
             with open(filename, 'w') as targetfile:
-                targetfile.write(json.dumps(parsed, indent=2))
+                #targetfile.write(json.dumps(parsed, indent=2))
+                nbformat.write(parsed, targetfile, 'ipynb')
             f = open(filename)
             for line in f:
                 print(line)
Implemented save notebook to disk.