[fix] fixes the problem with not detecting the end of the transmission