adding check to the key length