Fails if the key is a non-string type