tweak previous non-promise fix, found a bug
add an on request handler, so you can run pre and post request tasks