fixed bug where directory names with spaces caused failure