Add checkValid() method