Correct way to detect OS