fixed performance issues with timeout=0