bugfixes
added new commands to TD and changed how next jobs are retreived from datase
catch error when logfile could not be created