fixed a bug in --dry-run