Try statement in intermediate file removal