add timeout detection