changed OS X detection method