fixed clean files bug
added support for piping