some structure checking