update clear file function