structure: add IsValid() function