first write main.json when delete