Revert "first write main.json when delete"

This reverts commit 1e2ad88c524ae8eaaf98db9e33c5a613286da478.