Fix prevQuery bug

Fixes prevQuery bug by setting prevQuery to null when the modal bar is
closed