added len field in chat_header