fix mac platform code