retry 3 times
keygen