fix(middleware): use rev() rather than shifting handlers