add try/except for modalities