                                                :process proc
                                                :name (process-name proc)
                                                :calling-buffer (current-buffer)
-                                               :files-before (dwim-shell--dired-files)
+                                               :files-before files-before
                                                :reporter progress-reporter))
                   dwim-shell--execs))
       (set-process-sentinel proc #'dwim-shell--sentinel)

  (interactive)
  (let ((factor (string-to-number
                 (completing-read "Speed up x times: " '("1" "1.5" "2" "2.5" "3" "4")))))
    (dwim-shell--dired-execute-script-on-marked-files
     (format "gifsicle -U <<f>> <<frames>> -O2 -o <<fne>>_x%s.<<e>>" factor)
     "Speed up gif" '("gifsicle" "identify")
     (lambda (script file)

            (let ((default-directory default-directory))
              (dired-mode default-directory)
              (when revert-buffer-function
                (funcall revert-buffer-function nil t))
              (dwim-shell--dired-files))))))

(defun dwim-shell--dired-files ()
