* add check to prevent managed user from leaving managing org * remove unused vaiable * add null check