implemented deconstructor for addnewfile