fixed mac port

finnaly done the mac port