fix bug of not receving data from server