edited wait for deployment function to return status of the deployment