restore pgparam middleware