ContainsIllegalCharacterException created and getActiveEntities function created.