package, improve failure handling