Fix bug clearing logs while program running