var is_first, is_last ans selected added to the context