fix if logic in tag view