fixed tag search code to work with changed tag structure