Versions are changing too fast. It was still 2.7 when I downloaded it. Mount works the first time, but when unmounting, the directory is not or could not be removed from /media.
So when the key is mounted once more, the script fails on directory creation. My understanding is that two possibilities are to be considered: - The name resolves to empty directory not matching any active mount point. It can be used to mount the device. - The name is already used in a mount point. Either signal the issue or create a new moint point using a suffix.