complete error handling