adding missing locks in application undeployment and removal