make sure generated key is unique