fixed selection by reintroducing code I blasted