fixing minor bug with -r