use waitgroup instead of sleep(2)