fix platform specific code