Fix exec to run only when needed