write box json to file