fixed deployment script error checking