fixed track by for messages in chat2; fixed typescript