change feault keygen to call function each time