fixed bug where selectedCategory was not getting set based on user input, also whitespace