Improved timeout example