fixed macos bug