diff --git a/js/cam/processes/GCodeExporter.js b/js/cam/processes/GCodeExporter.js
index a9f0843b8b93529b7f1354075356a2768467b6ca..fd5ff5bacec7181e6f203b643a47b135831487b0 100644
--- a/js/cam/processes/GCodeExporter.js
+++ b/js/cam/processes/GCodeExporter.js
@@ -73,16 +73,16 @@ define(['underscore', 'cam', 'lattice', 'three'], function(_, cam, lattice, THRE
 
     GCodeExporter.prototype._goXYZ = function(x, y, z, command){
         if (x !== null) {
-            x = "X"+parseFloat(x).toFixed(3);
             this.postPosition.x = x;
+            x = "X"+parseFloat(x).toFixed(3);
         }
         if (y !== null) {
-            y = "Y"+parseFloat(y).toFixed(3);
             this.postPosition.y = y;
+            y = "Y"+parseFloat(y).toFixed(3);
         }
         if (z !== null) {
-            z = "Z"+parseFloat(z).toFixed(3);
             this.postPosition.z = z;
+            z = "Z"+parseFloat(z).toFixed(3);
         }
         if (command) return this.addLine(command, [x,y,z]);
         return this.addLine("G01", [x,y,z]);