implemented query close/open?
merged