update tag function to output an empty array when no results are found