streamlined error handling