fix token generation issue