fixed bug that a path with spaces would fail to execute script