adapt to macos