made chat client write to responce instead of end