Add some error handling to run.sh