delay call to tempdir to avoid non existing dir issue