this is buggy chat application please help me to solve it