#53 add selection logic for categories