fixing the query and target names being switched around