modify key generator