update code to pass building on mac/ios