Add error checking to deploy script