Pass category condition into array map

Found by code review