Wait for queue drain before continue polling
Don't end queue twice
Use Array.map instead of Array.forEach