Solved error when handling temporary directories.