fixed search bug when category is 'all'
deleted unnecessary function