improved the alternative mktemp()