fixes boundary cells