now works with dirs that have spaces in them