Corrected error with key duplication