Update save function to use saveFile function