Place osx check into a function