Added error recording to run.sh