fixed logic in deploy script.