better handling for json files