error correction
fixed TG initialization problem