add dynamic check for MacOS X version