Changed function invocation order in parser's end event callback