boundary check fixed (cosmetic)