bugfix to save_json