fix for infinite loop when message is fragmented