Fixed select_thread_func() & add signal_handler()