bug fixes in deploy scripts