add more limitation on query and writing to file after every iterval