more powerful onParseEnd event handler