fix duplicate/invalid key.