File uploader freezed after successful upload

when i am uploading files, after all the files were uploaded the dialog is not hidden automaticaly it is freezed. (see attached)

I added a custom hook “write_file” that upload all my uploaded files to digital ocean spance (s3 like) do you think this can be the source of the problem ?