what happens if n_applymode is not a str()? should be moved to an else.