Isn't there a chance here that px:tempdir will return the result of the name="temp-dir" step before px:mkdir gets a chance to run?