makeCollapse,checkFilename