only add context class if defined