boundry check