require middleware