Fix issue when purging logs