Update thFunctions.php