checking exit status of parts of script
stop agents if fail!