kill_thread method for controllers