fix clear for multi platform compatibility