BUG: Fixed a garbage collection issue

The query_widget was being garbage collected because I was
not maintaining a reference to the query_widget