Query hits being carried over

Problem: Query Hits being carried over to the next SMARTS query if the database doesn't have any compounds.
How can i avoid this. Either by not defining Query hits as global or using a cache?