fixed compilation for macos