tweaking of error handling