Fixes the bug in the sql for case when tag is selected
Merge pull request #430 from fahadhatib/develop

Fixes the bug in the sql for case when tag is selected