modified thread.php