renamed middleware. add 404 error.