Fixed condition to display tags correctly