added platform detection