fixed hook_query_TAG_alter to make it less redundant