Fixed bug when error returned from request.