corrected key ID size check