adding tag search logic