validity checking