Fixed concurrency problem with queue

Changed to BlockingQueue structure