avoid race condition by joining after all
maybe this is less CPU intensive
maybe this is less CPU intensive