added better support for ajax 404 error