add few logics into chat