I'm not sure about the `chmod`. Why is this needed?

If we do need to `chmod`, maybe it's better to use `X` (capital) instead of `x`. From the man page:

```
X       The execute/search bits if the file is a directory or any of the execute/search bits are set in the original (unmodified)
        mode.  Operations with the perm symbol ``X'' are only meaningful in conjunction with the op symbol ``+'', and are ignored
        in all other cases.
```