fixed thread_controller.php added index function