fix: clear event when set write callback