added script function to detect os