fix page specific middleware