Fix bug when producer next to consumer