add middleware to index