set a flag for preventing error callback than once(current case is CORS request can cause in xhr error and readysatechange error)