Fixed an error in my code.

Forgot to declare a variable and fixed the keyGen variable and renamed
it to id.