moved inner loop into function add_dtms_from_file
kill the tsbuilder subprocess when something goes wrong in add_dtms_from_file