Used CountDownLatch instead of sleep()