properly checking the key size