change to regular middleware. update documentation