fix gcode generation