forgot to merge mbuffer code