implementing blocking queue