             }
             catch let error as NSError {
                 print(validationErrorString + urlRequestString + error.localizedDescription)
-                handler(false, nil)
-                return
+                return handler(false, nil)
             }
             
             /// Parse json
             guard let parseJSON = json else {
                 print(validationErrorString + urlRequestString + "JSON parse error")
-                handler(false, nil)
-                return
+                return handler(false, nil)
             }
             
             /// Check for receipt status in json
             guard let status = parseJSON[JSONResponseKey.status.rawValue] as? Int else {
                 print(validationErrorString + urlRequestString + "Receipt status not found in json response")
-                handler(false, nil)
-                return
+                return handler(false, nil)
             }
             
             /// Check receipt status is valid
             guard status == ReceiptStatusCode.valid.rawValue else {
                 print(validationErrorString + urlRequestString + "Invalid receipt status in json response = \(status)")
-                handler(false, status)
-                return
+                return handler(false, status)
             }
             
             print("Valid receipt status in json reponse: \(status)")

            /// Handle request to sandbox server
            self.handleReceiptRequest(forURL: RequestURL.appleSandbox.rawValue, data: payloadData) { (isSuccess, status) in
                guard isSuccess else {
                    handler(false)
                    print(validationErrorString + "Status = \(status ?? ReceiptStatusCode.unknown.rawValue)")
                    return
                }
                    
                print("Receipt validation passed in sandbox mode, unlocking product(s)")

            
        catch let error as NSError {
            print(error.localizedDescription)
            return handler(false)
        }
        
        guard let payloadData = receiptPayloadData else {
            print(validationErrorString + "Payload data error")
            return handler(false)
        }
        
        /// URL request to production server first, if it fails because in test environment try sandbox
