Amend to factor in new query
bugfix