better handling of not-found errors