more uniform error handling