fix mac's buf