bug fix in lattice