Fix for uncaught exception error for 404 errors