Don't abuse make-variable-buffer-local. Fix call to add-hook.
Attach a file by drag & drop or click to upload