fix delete document on edit bug