example of handleEvent trick