fix 1d boundary bug