next step: implemnt chat function