Changed method to detect OS