add smarter error handling