change app to emit "error" events instead of app.error(fn)