optimized timeout