add platform detection (Darwin or Linux).