fix temp directory usage for testing