ARQ-1893 Refactor undeploy to check for application state
instead of waiting for 3000ms