fix for bug when there are outputs with 'cd'