Change delete files logic