fixing issue with uindefined sent to chat