add timeout for select