Added select t.* inside getTagData if statement