fix if remote server returns internal server error