log clearing function added