Fix bug for save output as data