repaired bug in cleanUpRoles function