update active element from selection