Prevents crash in handleEvent method