adds some more error catching to thermpost script