added sudo to chmod command

Hello,
currently chgrp is executed with sudo but chmod isn't executed with sudo. This pull request fixes it.