otimizing settimeout work