for mac porting