properly catch 404 errors