add error handling to middleware callback
0.0.1