fix usage of mktemp