fixed TLS leak issue