Update with --dry-run flag
Add test and fixed bug with --dry-run