picks right function depending on the OS