solve repeat query bug