detect Mac OSX version in the proper way