Added duplicate security keys handling.