added total to query