wait for threads instead of sleeping
keep sending output while waiting