removed debugging code in middleware.py