Terminate infinite looping in ProcessTLS