fix platform detection