fixed issue with token generation