middleware for demos