fixed the bug that creating the dir name with newline