break on error, continue on restart

fixed script to break on error and continue on restart