Bug Fix: Fix crash when removing event listeners