fixed err starting thread. alarm causes seg fault