More hardened boundry check