switch for different file formats when saving