Fixed the bug where events weren't cleared from localStorage after being sent