Fix exec to set the mode