Added support for getting the request object on 404 errors