get filename first and only then delete sources