GetBoardSqaure: added bound check