Added logic to work with favorite tags