fixing log clearing