adding producer consumer pattern