Update thread_controller.php

arrange try catch indention