fix receive timeout infinite loop issue