fix bug in paths with spaces