key duplication bug fixed