[ADDED]: added chat logic.