added function to export json file