fix output directory name - instead of using global - use local variable