fix bug when request is ajax