fixing some error on mac compilation