fix logic in deploy manager