make sure we really wait for threads o finish