delete info from files periodically and write in json file for  visualization with a thread