added basic chat func