applied changes from macos branch