Added support for windows in clear function