check for key length