fix chat flow