make event raising more robust and easier to debug