             
         catch let error as NSError {
             print(error.localizedDescription)
-            DispatchQueue.main.async {
-                handler(false, nil)
-            }
+            validationFailHandler(handler)
         }
         
         guard let payloadData = receiptPayloadData else {
             print(validationErrorString + "Payload data error")
-            DispatchQueue.main.async {
-                handler(false, nil)
-            }
-            
+            validationFailHandler(handler)
             return
         }
         

            }
        }
    }
}



            /// URL request error
            if let error = error {
                print(validationErrorString + urlRequestString + error.localizedDescription)
                requestFailHandler(handler)
                return
            }
            
            /// URL request data error
            guard let data = data else {
                print(validationErrorString + urlRequestString + "Data error")
                requestFailHandler(handler)
                return
            }
            
