improved timeout