fix last record and channel bug