fixed file and dir cleaning