Revert "bug fixes in deploy scripts"

This reverts commit 3e91576ac934a25420dc23feb1c882666decc9d8.