fixed event handler to pass the doc to schema, working 1.0.2
remove unnecessary doc variables