Fixed 404 middleware