fixes bug that made -r not work