fix optimize ntuple maker