proper cleanup of files