                             userDomain: userDomain,
                             completion: {(uploadedFile, renewedUserToken) -> Void in
                                 
-                                // refresh user token
-                                if renewedUserToken != nil {
-                                    
-                                    completion?(uploadedFile, renewedUserToken!)
-                                } else {
-                                    
-                                    completion?(uploadedFile, nil)
-                                }
-                        },
+                                var tempFile = fileObject
+                                tempFile.status.status = uploadedFile.status.status
+                                completion?(tempFile, renewedUserToken!)
+                            },
                             errorCallback: {(error) -> Void in
                                 
                                 errorCallBack?(error)
-                        })
-                })
-        },
+                            }
+                        )
+                    }
+                )
+            },
             errorCallback: {(error) -> Void in
                 
                 errorCallBack?(error)
-        })
+            }
+        )
     }
     
 }

                        }
                    }
                }
        })
    }
    // MARK: - Upload file to hat wrapper
    

                        }
                    }
                }
            }
        )
    }
    
    // MARK: - Upload File to hat
