maybe us len(key.strip()) to catch all-whitespace keys as well