fix typo
only allow cls statement for windows
fix write statements