Fix exec to set the mode

are you saying that the unless should be an onlyif?