update selected attribute on select