modified switch case method in thread_controller.php by adding try catch for validation