more pages and working middleware