implement new-query and run