require.js version; little update in handleEvent function