fix deploy.py race condition