added mktmp support