Add check for error messages