added a lot of query results defer closes