bug fix for select, made cmd buffer global, skeleton for dedup block