Updated error handling for 404 issues