fixed a bug where if category was slected and the search box was emptied, an exception would be thrown.