finalized logic for log limit