Remove unused variable $tagquery

Looks like most of this code was changed but one unused variable got left behind