Fix bug when not run dryrun