error handling improvements
merge