added flag for temp directory