added a function to validate if given position is real on the board