fixing conditional platform code