made it work with files containing spaces in their name