stupid waitgroup off-by-one