bug fix for chat from server

fix bug wrong index reference