fix a bug in add query/insertion event periodically
fix a bug in add query/insertion event periodically