add error handling to deploy.sh