detect malformed structure