added demo middleware