fixed problem where output directory contains spaces (wasn't properly escaped)