auto-query works, barring an infinite loop at first