add support for custom tmp directory