fix platform errors