Should use mkdtemp instead of mkstemp