add timeout control