ensure files delete if type is changing;pass flag params