Add buffer cleanup on save hook