add platform detection