Adding selected state to pins.