added tls.h functions